<?php
// +----------------------------------------------------------------------
// | Bwsaas
// +----------------------------------------------------------------------
// | Copyright (c) 2015~2020 http://www.buwangyun.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Gitee ( https://gitee.com/buwangyun/bwsaas )
// +----------------------------------------------------------------------
// | Author: buwangyun <hnlg666@163.com>
// +----------------------------------------------------------------------
// | Date: 2020-9-28 10:55:00
// +----------------------------------------------------------------------

namespace buwang\subscribe;

use app\bwmall\model\admin\BwmallUser;

/**
 * 订单事件
 * Class ProductSubscribe
 * @package buwang\subscribes
 */
class OrderSubscribe
{


    public function handle()
    {

    }

    /**
     * 订单支付成功
     * @param array $event
     */
    public function onOrderPaySuccess($event)
    {
        list($order, $formId) = $event;
        //更新用户支付订单数量
        BwmallUser::changePayCount($order['uid'], 1);//购买次数加1
        //检测开通分销权限
        BwmallUser::OpenBroker($order['uid']);

    }


}